<h2>DESCRIPTION</h2>

<em>db.login</em> sets login parameters such an user name and
optionally also a password, a hostname or a port for the connection to
the selected <b>database</b> through the DB <b>driver</b>.

<h2>NOTE</h2>

Options <b>host</b> and <b>port</b> are related to only SQL database
backends like <a href="grass-pg.html">PostgreSQL</a>,
<a href="grass-mysql.html">MySQL</a> or <a href="grass-odbc.html">ODBC</a>.

<p>
Note that the passwords are stored in a hidden, <i>unencrypted</i>
file in the user account, specifically

<ul>
<li> in the 'home' directory, i.e. <tt>$HOME/.grass8/dblogin</tt> (Unix-like systems)</li>
<li> <tt>%APPDATA%\Roaming\GRASS8\dblogin</tt> (MS-Windows)</li>
</ul>

Only the file owner can access this file.

<h2>EXAMPLES</h2>

Only username specified (assuming locally accessible PostgreSQL DB
without password):

<div class="code"><pre>
db.login driver=pg database=mydb
</pre></div>

<p>
Username, password and hostname specified (note that the command lines
history will store the password in this way):

<div class="code"><pre>
db.login driver=pg database=mydb user=bacava password=secret host=db.example.com
</pre></div>

<p>
Username and empty password specified:

<div class="code"><pre>
db.login driver=pg database=mydb user=bacava password=""
</pre></div>


<h2>SEE ALSO</h2>

<em>
<a href="db.connect.html">db.connect</a>,
<a href="db.test.html">db.test</a>,
<a href="db.tables.html">db.tables</a>
</em>

<p>
<a href="sql.html">SQL support in GRASS GIS</a>

<h2>AUTHOR</h2>

Radim Blazek<br>
Support for hostname and port by Martin Landa, OSGeoREL, Czech Technical University in Prague, Czech Republic (GRASS 7.1)

<!--
<p>
<i>Last changed: $Date$</i>
-->
